home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Demos / AppMaker 2.0b3 / Demo AppMaker 1.5 / Demo AppMaker™ / Demo AppMaker™.rsrc / TmpC_1013_Popup < prev    next >
Encoding:
Text File  |  1992-04-08  |  1.4 KB  |  58 lines

  1. %case window field%
  2.     short            %fieldname%;
  3. %case create%
  4.     cur->%fieldname% = 1;
  5. %case mousein%
  6.     GetWRect (%itemname%, &bounds);
  7.     if (PtInRect (where, &bounds)) {
  8.         TrackPopup (bounds, %popupID%, &cur->%fieldname%);
  9.     }
  10. %case update%
  11.     GetWRect (%itemname%, &bounds);
  12.     UpdatePopup (bounds, %popupID%, cur->%fieldname%);
  13. %case itemNr%
  14.     %DefineItem%
  15. %case dialog field%
  16.     short            %fieldname%;
  17.     %haveField%
  18. %case init field%
  19.     info->%fieldname% = 1;
  20. %case auxiliaryProto%
  21.     static pascal void Draw%itemname%%    %(DialogPtr        whichDialog,
  22.                                          short            itemNr);
  23. %case auxiliary%
  24.     %set needsRefCon = true%
  25.     /*----------*/
  26.     static pascal void Draw%itemname%%    %(DialogPtr        whichDialog,
  27.                                          short            itemNr)
  28.     {
  29.         %dlogname%RecPtr%    %data;
  30.  
  31.     %if lang = MPW%
  32.     #pragma unused (whichDialog) 
  33.     
  34.     %end if%
  35.         data = (%dlogname%RecPtr) GetWRefCon (whichDialog);
  36.         DrawPopup (itemNr, %popupID%, data->%fieldname%);
  37.     } /*Draw%itemname%*/
  38.  
  39. %case set%
  40.     %if lang = AUX%
  41.         SetUserItem (%itemname%, (ProcPtr) Draw%itemname%);
  42.     %else%
  43.         SetUserItem (%itemname%, (ProcPtr) &Draw%itemname%);
  44.     %endif%
  45. %case hit%
  46.     case %itemname%:
  47.             %if not labelName = %
  48.                 InvertLabel (%labelName%);
  49.             %endif%
  50.             DoPopup (%itemname%, %popupID%, &info->%fieldname%);
  51.             %if not labelName = %
  52.                 InvertLabel (%labelName%);
  53.             %endif%
  54.             %if menuName = Sound%
  55.                 PlaySound (%menuName%Menu, info->%fieldname%);
  56.             %endif%
  57.         break;
  58.